﻿namespace ScrumLite.Services
{
    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using Contracts;
    using System.ServiceModel;
    
    [ServiceContract]
    public interface IRequestsService
    {
        [OperationContract]
        Request[] GetCommittedRequests(string projectId);

        [OperationContract]
        void SaveRequests(string projectId, Request[] requests);

        [OperationContract]
        void SetPriorities(Guid[] requestIds);

        [OperationContract]
        int AddRequest(string projectId, Request request);

        [OperationContract]
        void DeleteRequest(Guid requestId);

        [OperationContract]
        void UpdateRequest(string projectId, Request request);

        [OperationContract]
        Dictionary<string, string> GetStatusList();

        [OperationContract]
        Request GetRequest(string projectId, int moniker);

        [OperationContract]
        Collection<Request> GetRequests(string projectId, string workArea);

        [OperationContract]
        Request[] GetOpenedRequests(string projectId);

        [OperationContract]
        void AssignWorkAreas(string projectId, int moniker, string[] workAreaIds);

        [OperationContract]
        Dictionary<int, int> GetWeeklyWeight(string projectId);

        [OperationContract]
        Dictionary<WorkArea, Dictionary<RequestStatus, int>> GetRequestsByStatusByWorkArea(string projectId);

        [OperationContract]
        Dictionary<RequestStatus, int> GetRequestsByStatus(string projectId);

        //TODO: Extract to new WorkAreasService
        [OperationContract]
        WorkAreaWeight[] GetWorkAreasGroupByWeight(string projectId);

        [OperationContract]
        WorkArea GetWorkArea(string projectId, Guid id);

        [OperationContract]
        void SaveWorkArea(WorkArea wa, Guid projectId);

        [OperationContract]
        WorkArea[] GetWorkAreas(string projectId);

        [OperationContract]
        WorkArea[] GetWorkAreasByMoniker(string projectId, int moniker);

        [OperationContract]
        void CleanCommitted(string projectId, RequestStatus[] statusToUpdateCommitted);

        [OperationContract]
        int GetRequestsTotalWeight(string projectId);

        [OperationContract]
        Dictionary<DayOfWeek, int> GetCommittedDailyWeight(string projectId);

        [OperationContract]
        int GetCommittedRequestsTotalWeight(string projectId);
    }
}
